import dataConfig from './config'

let  context= {
    app_version: String,
    environment: String,
    config: Object,
    win: Object,

    contextInit(win){
        let that = context;
        Object.defineProperty(that, 'app_version', { writable: false, value: dataConfig.app_version });  //设置只读
        Object.defineProperty(that, 'environment', { writable: false,value:dataConfig.environment });
        Object.defineProperty(that, 'config', { writable: false,value:dataConfig[dataConfig.environment]});
        Object.defineProperty(that, 'win', { writable: false,value: win});

        console.log("context.contextInit","environment",dataConfig.environment);
    },

    getVersion(){
        return context.app_version;
    },

    getEnvir(){
        return context.environment;
    },
}

export default context;